package jpb.module.dao.manager;

import jpb.module.dao.manager.mapper.ManagerOrgMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * Created by haol on 2017/4/1.
 */
@Repository
public class ManagerOrgDao {
        private Logger logger = LoggerFactory.getLogger(ManagerOrgDao.class);

        @Autowired
        private ManagerOrgMapper mapper;

        public void add(String mid, String oid,Integer founder) {
                try {
                        mapper.add(mid, oid,founder);
                } catch (Exception e) {
                        logger.error(e.getMessage());
                }
        }
        public Integer get(String mid, String oid,Integer founder) {
                try {
                        return mapper.get(mid, oid,founder);
                } catch (Exception e) {
                        logger.error(e.getMessage());
                        return null;
                }
        }

        public void delete(String mid, String oid) {
                try {
                        mapper.delete(mid, oid);
                } catch (Exception e) {
                        logger.error(e.getMessage());
                }
        }
        public void delete(String oid) {
                try {
                        mapper.deleteByOid(oid);
                } catch (Exception e) {
                        logger.error(e.getMessage());
                }
        }
//        public void deleteByMid(String mid) {
//                try {
//                        mapper.deleteByMid(mid);
//                } catch (Exception e) {
//                        logger.error(e.getMessage());
//                }
//        }

}
